<?php


namespace App\Listener;


use Hyperf\Event\Contract\ListenerInterface;
use App\Event\UserRegistered;
use Hyperf\Event\Annotation\Listener;

/**
 * @Listener(priority=2)
 * Class UserRegisteredListener
 * @package App\Listener
 */
class UserRegisteredListener implements ListenerInterface
{

    public function listen(): array
    {
        // 返回一个该监听器要监听的事件数组，可以同时监听多个事件
        return [
            UserRegistered::class,
        ];
    }

    public function process(object $event)
    {
        print_r($event);
        // TODO: Implement process() method.
    }
}